/*
 * @Author: xujianxing
 * @Date: 2020-02-18 17:41:20
 * @LastEditors  : xujianxing
 * @LastEditTime : 2020-02-18 18:11:29
 * @Description: react 跨域配置
 */
const proxy = require("http-proxy-middleware");

module.exports = function(app) {
  app.use(
    proxy("/api", {
      target: "http://localhost:4000",
      secure: true,
      changeOrigin: true,
      pathRewrite: {
        "^/api": "/"
      }
    })
  );
};
